package sales.seesion.stateless;

import javax.ejb.Stateless;
import javax.ejb.LocalBean;

@Stateless
@LocalBean
public class ConvertManageSessionBean {

    public String productCode;
    public String companyTypeCode;

    public String productNameCodeConvert(String productName) {
        if (productName.toUpperCase().equals("CLASSIC NUTRI BAR-NUTS")) {
            productCode = "A";
        } else if (productName.toUpperCase().equals("Classic Nutri Bar-Fruits")) {
            productCode = "B";
        } else if (productName.toUpperCase().equals("Premium Power Bar-Chocolate Nuts")) {
            productCode = "C";
        } else if (productName.toUpperCase().equals("Premium Power Bar-Redcurrant Fruits")) {
            productCode = "D";
        } else //not belong to any of current existing product category
        {
            productCode = "00";
        }

        return productCode;
    }
    
    public String companyTypeNameCodeConvert(String companyType){
        if(companyType.toUpperCase().equals("DIRECT SALES"))
            companyTypeCode="DS";
        else if(companyType.toUpperCase().equals("WHOLE SALES"))
            companyTypeCode="WS";
        else
            companyTypeCode="00";
        
        return companyTypeCode;
        
    }
    
   
    
    
}
